/*
 * Some CSS that should be applied in QuPath.
 */

/* Define colors that may be used by script editors and log viewers */
.root {
	
  -qp-script-text-color: -fx-text-background-color;
	
  -qp-script-background-color: -fx-control-inner-background;

  -qp-script-error-color: ladder(-qp-script-background-color, red 30%, darkred 50%, red 70%);

  -qp-script-warn-color: darkorange; /* ladder(-qp-script-background-color, darkorange 30%, orange 50%, darkorange 70%); */

  -qp-script-info-color: -qp-script-text-color;

  -qp-script-debug-color: ladder(-qp-script-background-color, derive(royalblue, 25%) 49%, derive(royalblue, -5%) 50%);

  -qp-script-trace-color: ladder(-qp-script-background-color, derive(-qp-script-text-color, -30%) 49%, derive(-qp-script-text-color, 30%) 50%);
  
  -qp-script-keyword-color: ladder(-qp-script-background-color, darkorange 50%, orange 51%);
  
  -qp-script-paren-color: -qp-script-text-color;

  -qp-script-bracket-color: -qp-script-text-color;

  -qp-script-brace-color: -qp-script-text-color;

  -qp-script-semicolon-color: -qp-script-text-color;

  -qp-script-string-color: ladder(-qp-script-background-color, derive(seagreen, 50%) 49%, derive(seagreen, -5%) 50%);

  -qp-script-number-color: ladder(-qp-script-background-color, derive(orange, 50%) 49%, derive(orange, -5%) 50%);

  -qp-script-comment-color: ladder(-qp-script-background-color, derive(-qp-script-text-color, -30%) 49%, derive(-qp-script-text-color, 30%) 50%);
  
  -qp-script-link-color: ladder(-qp-script-background-color, derive(purple, 25%) 49%, derive(purple, -5%) 50%);

  -qp-script-tag-color: ladder(-qp-script-background-color, derive(orange, 25%) 49%, derive(orange, -5%) 50%);

  -qp-script-attribute-color: ladder(-qp-script-background-color, derive(royalblue, 25%) 49%, derive(royalblue, -5%) 50%);

  -qp-script-tag-color: -qp-script-text-color;

}


/* Soften the main toolbar icons */
.tool-bar .qupath-icon * {
  -fx-opacity: 0.8;
}

/* Adapt menu icon colors */
.menu-item > * > .qupath-icon {
  -fx-text-fill: -fx-text-base-color;
}

/* Used in command finder for help text */
.popover * {
    -fx-background-color: -fx-base;
    -fx-text-fill: -fx-text-base-color;
}

/* Style a minimal colorpicker (just a clickable square) */
.minimal-color-picker {
  -fx-color-label-visible: false;
  -fx-background-color: null;
}

.minimal-color-picker > .color-picker-label {
  -fx-padding: 0;
}

.minimal-color-picker:hover {
  -fx-effect: dropshadow(two-pass-box , rgba(0, 0, 0, 0.2), 5, 0.0 , 0, 2);
}

.minimal-color-picker:focused {
  -fx-background-color: null;
  -fx-background-radius: 0;
}

.minimal-color-picker > .color-picker-label > .picker-color > .picker-color-rect {
  -fx-stroke: null;
}

/* Set opacity for 1, even if the control is disabled (usually sets opacity to 0.4) */
.always-opaque,
.always-opaque:hover,
.always-opaque:focused,
.always-opaque:disabled,
.always-opaque:disabled > * {
  -fx-opacity: 1;
}

.info-message {
  -fx-effect: dropshadow(three-pass-box, rgba(0, 0, 0, 0.5), 1, 0, 0, 0);
}

.info-message.warn {
  -fx-fill: -qp-script-warn-color;
}

.info-message.error {
  -fx-fill: -qp-script-error-color;
}

.info-message.info {
  -fx-fill: -qp-script-debug-color;
}

.warn-label-text {
  -fx-text-fill: -qp-script-warn-color;
}

.error-label-text {
  -fx-text-fill: -qp-script-error-color;
}

.toolbar-badge > .badge-text {
  -fx-fill: white;
  -fx-font-size: 6pt;
  -fx-font-weight: bold;
  -fx-text-alignment: center;
}

.list-cell > .failed-extension {
  -fx-text-background-color: -qp-script-error-color;
  -fx-opacity: 0.8;
}

.list-cell .extension-manager-list-icon {
  -fx-text-fill: -fx-text-background-color;
}

.list-cell > .failed-extension .extension-manager-list-icon {
  -fx-text-fill: -qp-script-error-color;
}


/* Don't make the title for the training piechart too large */
.training-chart .chart-title {
  -fx-font-size: 1em;
  -fx-font-weight: bold;
}
